package com.yf.ability.upload.providers.local.service;

import com.yf.ability.upload.providers.local.dto.UploadReqDTO;
import com.yf.ability.upload.providers.local.dto.UploadRespDTO;
import com.yf.ability.upload.providers.local.config.LocalConfig;
import org.springframework.core.io.FileSystemResource;
import org.springframework.core.io.InputStreamResource;
import org.springframework.http.ResponseEntity;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;

/**
 * 阿里云OSS业务类
 * @author bool 
 * @date 2019-07-12 16:45
 */
public interface LocalUpService {

    /**
     * 文件上传
     * @param reqDTO
     * @return
     */
    UploadRespDTO upload(UploadReqDTO reqDTO);

    /**
     * 文件上传
     * @param localFile
     * @return
     */
    String upload(String localFile);


    /**
     * 文件刪除
     * @param fileURI
     * @return
     */
    boolean delete(String fileURI);

    /**
     * 批量文件删除
     * @param fileURIs
     * @return
     */
    boolean delete(List<String> fileURIs);

    /**
     * 下载文件
     * @param request
     * @param response
     * @throws IOException
     */
    void download(HttpServletRequest request, HttpServletResponse response) throws IOException;

    /**
     * 获取配置
     * @return
     */
    LocalConfig getConfig();
}
